package com.example.demo.listener;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2018\11\13 0013.
 * 定义一个事件监听器MyApplicationListener实现ApplicationListener接口
 */
//@Component
public class MyApplicationListener implements ApplicationListener<MyApplicationEvent>{
    @Override
    public void onApplicationEvent(MyApplicationEvent event) {
        System.out.println("接收到事件："+event.getClass());
    }
}
